﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Billder
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //HeadLoginView.NamingContainer.
            DataTable dt = Catalog.runSearch("PartMaster", "2", "FKStatus");
            if (dt.Rows.Count == 0)
            {
                return;
            }
            addBadge(dt);
        }

        private void addBadge(DataTable dt)
        {
            Panel p = new Panel();
            p.CssClass = "badge";
            p.ID = "badgeDiv";
            Table t = new Table();
            t.CellPadding = 0;
            t.CellSpacing = 0;
            TableRow r = new TableRow();
            TableCell c1 = new TableCell();
            c1.CssClass = "badgeLeft";
            c1.Text = " ";
            TableCell c2 = new TableCell();
            HyperLink l = new HyperLink();
            l.Text = dt.Rows.Count.ToString();
            l.NavigateUrl = "javascript: showPartTickets();";
            c2.Controls.Add(l);
            TableCell c3 = new TableCell();
            c3.CssClass = "badgeRight";
            c3.Text = " ";
            r.Cells.Add(c1);
            r.Cells.Add(c2);
            r.Cells.Add(c3);
            t.Rows.Add(r);
            p.Controls.Add(t);
            mainHeader.Controls.Add(p);
            
        }

        protected void HeadLoginView_ViewChanged(object sender, EventArgs e)
        {

        }

        protected void HeadLoginStatus_LoggingOut(object sender, LoginCancelEventArgs e)
        {

        }
        
    }
}
